package com.i_art_engineer.meigong.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.util.AttributeSet;
import android.widget.EditText;

/**
 *
 */
public class InputText extends EditText{

    private float degree=0;

    public void roate(float degree)
    {
        this.degree = degree;
        this.invalidate();
    }

    public InputText(Context context) {
        super(context);
    }

    public InputText(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onDraw(Canvas canvas) {
        //倾斜度45,上下左右居中
        canvas.rotate(degree, getMeasuredWidth() / 2, getMeasuredHeight() / 2);
        super.onDraw(canvas);
    }

}
